package net.sf.fc.script;

import javax.xml.namespace.QName;

public enum SchemaData {

    COPY("http://sf.net/fc/script/gen/copy", "copyScript", "net.sf.fc.script.gen.copy"),
    OPTIONS("http://sf.net/fc/script/gen/options", "options", "net.sf.fc.script.gen.options"),
    SETTINGS("http://sf.net/fc/script/gen/settings", "settings", "net.sf.fc.script.gen.settings");

    private SchemaData(String namespace, String localPart, String contextPath) {
        this.namespace = namespace;
        qname = new QName(namespace, localPart);
        xsdName = buildXsdName(localPart);
        this.contextPath = contextPath;
    }

    private String buildXsdName(String localPart) {
        return new StringBuilder().append(localPart.substring(0,1).toUpperCase())
                .append(localPart.substring(1))
                .append(".xsd").toString();
    }

    public String namespace() {
        return namespace;
    }

    public QName qname() {
        return qname;
    }

    public String xsdName() {
        return xsdName;
    }

    public String contextPath() {
        return contextPath;
    }

    private final String namespace;
    private final QName qname;
    private final String xsdName;
    private final String contextPath;

}
